import React from './react';//核心库
import ReactDOM from './react-dom';//DOM渲染库

/* let element = (
  <h1 className="title" style={{ color: 'red' }}>
    hello
    <span>world</span>
  </h1>
) */
/* var element = React.createElement("h1", {
  className: "title",
  style: {
    color: 'red',
    fontSize: '50px'
  }
}, "hello", React.createElement("span", null, "world"));
 */
/*
 这是我们的函数组件
 function Welcome(props) {
  return React.createElement("h1", {
    className: "title",
    style: {
      color: 'red',
      fontSize: '50px'
    }
  }, "hello1", React.createElement("span", null, "world1"));
} */
class Welcome extends React.Component {
  render() {
    return React.createElement("h1", {
      className: "title",
      style: {
        color: 'red',
        fontSize: '50px'
      }
    }, "hello2", React.createElement("span", null, "world2"));
  }
}
//let element = <Welcome />;
//createElement的类型可能是一个函数，不一定是一个字串。原生DOM是字符串，类组件和函数数组是function
let element = React.createElement(Welcome, {});
console.log(element);

ReactDOM.render(element, document.getElementById('root'));